<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5">
{
  style: {
    navigationStyle: 'custom',
    navigationBarTitleText: '代抄代写',
  },
}
</route>

<template>
  <view class="bg overflow-hidden pt-11" :style="{ marginTop: safeAreaInsets?.top + 'px' }">
    <view class="top">
      <view class="flex items-center">
        <img
          style="margin-left: 1.13rem"
          src="@/static/app/custom-icon/ze-arrow-left%201@1x.png"
          alt=""
          @click="handleClickLeft"
        />
        <text class="title">代抄代写</text>
      </view>
    </view>

    <view class="input-title">
      <text class="services-title">请输入服务标题</text>
      <text class="tips">（必填）</text>
    </view>

    <view class="text-area">
      <text class="services-title">请输入服务内容</text>
    </view>
    <view style="margin-bottom: -0.88rem">
      <form-item :formData="formItemOne"></form-item>
    </view>
    <view style="margin-bottom: -0.88rem">
      <form-item :formData="formItemTwo"></form-item>
    </view>
    <view style="margin-bottom: -0.88rem">
      <form-item :formData="formItemThree"></form-item>
    </view>
    <view style="margin-bottom: -0.88rem">
      <form-item :formData="formItemFour"></form-item>
    </view>
    <view style="padding-bottom: 3.88rem">
      <form-item :formData="formItemFive"></form-item>
    </view>
    <bottom-money></bottom-money>
  </view>
</template>

<script setup lang="ts">
// 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync()

const formItemOne = ref([
  {
    formType: 'select',
    formLabel: '收货地址',
    formBottomBorder: true,
    formValue: '暂无',
    formValueColor: '#808080',
  },
  {
    formType: 'select',
    formLabel: '附件上传',
    formValue: '待上传',
    formValueColor: '#808080',
  },
])
const formItemTwo = ref([
  {
    formType: 'readOnlyText',
    formLabel: '费用小计',
    formValue: '请输入金额',
  },
])
const formItemThree = ref([
  {
    showMoney: true,
    formType: 'select',
    formLabel: '平台优惠券',
    formValue: '无可用券',
  },
])

const formItemFour = ref([
  {
    formType: 'select',
    formLabel: '订单自动取消时间',
    formValue: '不限',
  },
])

const formItemFive = ref([
  {
    formType: 'readOnlyText',
    formLabel: '备注',
    formValue: '请输入',
  },
])
const handleClickLeft = () => {
  uni.navigateBack()
}
</script>

<style scoped lang="scss">
.bg {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  background-color: rgba(242, 243, 247, 1);

  .top {
    width: 100%;
    padding-bottom: 1.63rem;
  }

  .form {
    width: 20.69rem;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 1);
    border-radius: 1rem;

    .form-item {
      padding: 1.06rem 0.94rem 1.06rem 0.75rem;
      border-bottom: 0.06rem solid rgba(187, 187, 187, 1);

      .form-item-left {
        .form-item-left-text {
          font-family: SourceHanSansSC-regular;
          font-size: 1rem;
          line-height: 1.44rem;
          color: rgba(0, 0, 0, 1);
          text-align: left;
        }
      }

      .form-item-right {
        .form-item-right-text {
          font-family: SourceHanSansSC-regular;
          font-size: 1rem;
          line-height: 1.44rem;
          color: #808080;
          text-align: left;
        }
      }
    }
  }

  .btn {
    width: 20.69rem;
    height: 2.88rem;
    font-family: SourceHanSansSC-regular;
    font-size: 1rem;
    line-height: 2.88rem;
    color: rgba(255, 255, 255, 1);
    text-align: center;
    background-color: rgba(88, 143, 255, 1);
    border-radius: 1.44rem;
  }
}

.title {
  position: absolute;
  left: 50%;
  height: 1.75rem;
  font-family: SourceHanSansSC-bold;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: rgba(16, 16, 16, 1);
  transform: translateX(-50%);
}

.input-title {
  box-sizing: border-box;
  width: 21rem;
  height: 3.56rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  padding-left: 0.44rem;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 0.63rem;

  .tips {
    color: #cd6258;
  }

  text {
    height: 13.63rem;
    font-family: SourceHanSansSC-regular;
    font-size: 1.13rem;
    line-height: 1.56rem;
    color: rgba(108, 108, 108, 0.76);
    text-align: left;
  }
}

.text-area {
  box-sizing: border-box;
  width: 21rem;
  height: 5.06rem;
  padding-top: 1.19rem;
  padding-left: 0.5rem;
  margin: 0.69rem 0 1rem 0;
  font-family: PingFangSC-regular;
  font-size: 0.88rem;
  line-height: 1.25rem;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 0.63rem;

  text {
    font-family: PingFangSC-regular;
    font-size: 1.13rem;
    line-height: 1.25rem;
    color: #9a9a9a;
    border-radius: 0.63rem;
  }
}
</style>
